package com.badibadi.adapter;

import java.util.List;

import net.tsz.afinal.FinalBitmap;

import com.badibadi.activity.ActivityReadingActivity;
import com.badibadi.activity.PinyinSeeActivityTheOriginatorLookParticipantsActivity;
import com.badibadi.infos.Activity_Overview_Model;
import com.badibadi.mytools.BitmapHelp;
import com.badibadi.mytools.CalendarTools;
import com.badibadi.mytools.Constants;
import com.badibadi.mytools.Utils;
import com.badibadi.mytools.ViewHolder;
import com.badibadi.uniclubber.R;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.assist.FailReason;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

//Intent start
public class AfterLandingMyHomePageAllAdapter_1 extends BaseAdapter {
	private static final String TAG = "AfterLandingMyHomePageAllAdapter_1";
	private DisplayImageOptions options;
	private List<Activity_Overview_Model> activity_Overview_Models;
	private Context context;
	// FinalBitmap finalBitmap;
	private int Type;
	private double map_x, map_y;
	private String is_main_ye;// 1,是；2，不是

	public AfterLandingMyHomePageAllAdapter_1(
			List<Activity_Overview_Model> activity_Overview_Models,
			Context context, int t, double map_x, double map_y,
			String is_main_ye) {
		options = new DisplayImageOptions.Builder()
				.showStubImage(R.drawable.ic_stub)
				.showImageForEmptyUri(R.drawable.noimage)
				.showImageOnFail(R.drawable.noimage).cacheInMemory()
				.cacheOnDisc().displayer(new RoundedBitmapDisplayer(5)).build();
		this.activity_Overview_Models = activity_Overview_Models;
		this.context = context;
		this.map_x = map_x;
		this.map_y = map_y;
		this.is_main_ye = is_main_ye;
		Type = t;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return activity_Overview_Models.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return activity_Overview_Models.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub fragment_myrl_import_type_name
		if (convertView == null) {
			convertView = ViewHolder.buildView(context,
					R.layout.activity_over_view_adapter_kanhuodong, parent);
		}
		ViewHolder viewHolder = (ViewHolder) convertView.getTag();
//		   
		final ImageView fragment_myrl_import_background_img = viewHolder
				.getViewById(R.id.fragment_myrl_import_background_img);// 背景
		FrameLayout frame_activity_check = viewHolder
				.getViewById(R.id.frame_activity_check);
		LinearLayout see_canyuzhe = viewHolder.getViewById(R.id.see_canyuzhe);// 查看点击事件图片
		ImageView fragment_myrl_import_user_img1 = viewHolder
				.getViewById(R.id.fragment_myrl_import_user_img1);// 个人头像背景1
		ImageView fragment_myrl_import_user_img2 = viewHolder
				.getViewById(R.id.fragment_myrl_import_user_img2);// 个人头像背景2
		ImageView fragment_myrl_import_user_img3 = viewHolder
				.getViewById(R.id.fragment_myrl_import_user_img3);// 个人头像背景3
		ImageView fragment_myrl_import_user_img4 = viewHolder
				.getViewById(R.id.fragment_myrl_import_user_img4);// 个人头像背景4
		ImageView fragment_myrl_import_user_img5 = viewHolder
				.getViewById(R.id.fragment_myrl_import_user_img5);// 个人头像背景5
		ImageView fragment_myrl_import_user_img6 = viewHolder
				.getViewById(R.id.fragment_myrl_import_user_img6);// 个人头像背景6
		TextView fragment_myrl_import_adress_textview = viewHolder
				.getViewById(R.id.fragment_myrl_import_adress_textview);// 活动名称
		TextView f_m_i_l_starttime = viewHolder
				.getViewById(R.id.f_m_i_l_starttime);// 开始时间
		TextView f_m_i_l_overtime = viewHolder
				.getViewById(R.id.f_m_i_l_overtime);// 结束时间
		TextView f_m_i_l_name = viewHolder.getViewById(R.id.f_m_i_l_name);// 线上主题
		TextView fragment_myrl_import_instance = viewHolder
				.getViewById(R.id.fragment_myrl_import_instance);// 距离(显示附近适用)
		TextView fragment_myrl_import_type_name = viewHolder
				.getViewById(R.id.fragment_myrl_import_type_name);// 类型fragment_myrl_import_type_name
		TextView fragment_myrl_import_user_more = viewHolder
				.getViewById(R.id.fragment_myrl_import_user_more);// 查看更多
		fragment_myrl_import_adress_textview.setText(activity_Overview_Models
				.get(position).getNames());
		try {
			f_m_i_l_starttime.setText(CalendarTools.getFormatTime(Double
					.parseDouble((activity_Overview_Models.get(position)
							.getStart_time() + "000")), "yyyy-MM-dd"));
			//    
			f_m_i_l_overtime.setText(CalendarTools.getFormatTime(Double
					.parseDouble((activity_Overview_Models.get(position)
							.getEnd_time() + "000")), "yyyy-MM-dd"));
		} catch (Exception e) {
			// TODO: handle exception
			f_m_i_l_starttime.setText(activity_Overview_Models.get(position)
					.getStart_time());
			f_m_i_l_overtime.setText(activity_Overview_Models.get(position)
					.getEnd_time());
		}

		if (activity_Overview_Models.get(position).getType_name() != null) {
			fragment_myrl_import_type_name.setText(""
					+ activity_Overview_Models.get(position).getType_name());
		} else {
			fragment_myrl_import_type_name.setText(""
					+ activity_Overview_Models.get(position).getTypeName());
		}

		if (activity_Overview_Models.get(position).getIs_online().equals("1")) {
			f_m_i_l_name.setText(context.getResources().getString(
					R.string.OnlineTheme));
		} else if (activity_Overview_Models.get(position).getIs_online()
				.equals("0")) {
			f_m_i_l_name.setText(""
					+ activity_Overview_Models.get(position).getAddress());
		}
		if (Type != 3) {
			fragment_myrl_import_instance.setVisibility(View.GONE);
		} else {
			fragment_myrl_import_instance.setVisibility(View.VISIBLE);
			try {
				fragment_myrl_import_instance.setText(Utils.GetLongDistance(
						map_y, map_x, Double.valueOf(activity_Overview_Models
								.get(position).getMap_y()), Double
								.valueOf(activity_Overview_Models.get(position)
										.getMap_x())));
//				   
//						+ "对方的经纬度是:"
//						+ activity_Overview_Models.get(position).getMap_y()
//						+ " "
//						+ activity_Overview_Models.get(position).getMap_x());
			} catch (Exception e) {
				// TODO: handle exception
			}

		}

//		ImageLoader.getInstance().displayImage(
//				Constants.BadiDownImgUrl
//						+ activity_Overview_Models.get(position).getImage()
//						+ Constants.Appactivitycover,
//				fragment_myrl_import_background_img, options);
		new BitmapHelp().displayImage(context, fragment_myrl_import_background_img, Constants.BadiDownImgUrl
						+ activity_Overview_Models.get(position).getImage()
						+ Constants.Appactivitycover);
		if (activity_Overview_Models.get(position).getUser_info() != null
				&& activity_Overview_Models.get(position).getUser_info().size() > 0) {
			for (int i = 0; i < activity_Overview_Models.get(position)
					.getUser_info().size(); i++) {
				switch (i) {
				case 0:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser_info().get(0).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img1, options);
					break;
				case 1:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser_info().get(1).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img2, options);
					break;
				case 2:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser_info().get(2).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img3, options);
					break;
				case 3:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser_info().get(3).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img4, options);
					break;
				case 4:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser_info().get(4).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img5, options);
					break;
				case 5:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser_info().get(5).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img6, options);
					break;

				default:
					break;
				}
			}
			fragment_myrl_import_user_img1.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img2.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img3.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img4.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img5.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img6.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_more.setVisibility(View.VISIBLE);
			if (activity_Overview_Models.get(position).getUser_info().size() <= 5) {
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			}
			if (activity_Overview_Models.get(position).getUser_info().size() <= 1) {
				fragment_myrl_import_user_img2.setVisibility(View.GONE);
				fragment_myrl_import_user_img3.setVisibility(View.GONE);
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUser_info()
					.size() <= 2) {
				fragment_myrl_import_user_img3.setVisibility(View.GONE);
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUser_info()
					.size() <= 3) {
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUser_info()
					.size() <= 4) {
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUser_info()
					.size() < 5) {
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUser_info()
					.size() < 6) {
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
			}
		} else if (activity_Overview_Models.get(position).getAddUser() != null
				&& activity_Overview_Models.get(position).getAddUser().size() > 0) {
//			   
			for (int i = 0; i < activity_Overview_Models.get(position)
					.getAddUser().size(); i++) {
				switch (i) {
				case 0:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getAddUser().get(0).getHead(),
							fragment_myrl_import_user_img1, options);
					break;
				case 1:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getAddUser().get(1).getHead(),
							fragment_myrl_import_user_img2, options);
					break;
				case 2:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getAddUser().get(2).getHead(),
							fragment_myrl_import_user_img3, options);
					break;
				case 3:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getAddUser().get(3).getHead(),
							fragment_myrl_import_user_img4, options);
					break;
				case 4:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getAddUser().get(4).getHead(),
							fragment_myrl_import_user_img5, options);
					break;
				case 5:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getAddUser().get(5).getHead(),
							fragment_myrl_import_user_img6, options);
					break;

				default:
					break;
				}
			}
			fragment_myrl_import_user_img1.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img2.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img3.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img4.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img5.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img6.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_more.setVisibility(View.VISIBLE);
			if (activity_Overview_Models.get(position).getAddUser().size() <= 5) {
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			}
			if (activity_Overview_Models.get(position).getAddUser().size() <= 1) {
				fragment_myrl_import_user_img2.setVisibility(View.GONE);
				fragment_myrl_import_user_img3.setVisibility(View.GONE);
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getAddUser()
					.size() <= 2) {
				fragment_myrl_import_user_img3.setVisibility(View.GONE);
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getAddUser()
					.size() <= 3) {
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getAddUser()
					.size() <= 4) {
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getAddUser()
					.size() < 5) {
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getAddUser()
					.size() < 6) {
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
			}
		} else if (activity_Overview_Models.get(position).getUserInfo() != null
				&& activity_Overview_Models.get(position).getUserInfo().size() > 0) {
			for (int i = 0; i < activity_Overview_Models.get(position)
					.getUser_info().size(); i++) {
				switch (i) {
				case 0:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUserInfo().get(0).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img1, options);
					break;
				case 1:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUserInfo().get(1).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img2, options);
					break;
				case 2:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUserInfo().get(2).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img3, options);
					break;
				case 3:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUserInfo().get(3).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img4, options);
					break;
				case 4:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUserInfo().get(4).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img5, options);
					break;
				case 5:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUserInfo().get(5).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img6, options);
					break;

				default:
					break;
				}
			}
			fragment_myrl_import_user_img1.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img2.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img3.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img4.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img5.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img6.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_more.setVisibility(View.VISIBLE);
			if (activity_Overview_Models.get(position).getUserInfo().size() <= 5) {
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			}
			if (activity_Overview_Models.get(position).getUserInfo().size() <= 1) {
				fragment_myrl_import_user_img2.setVisibility(View.GONE);
				fragment_myrl_import_user_img3.setVisibility(View.GONE);
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUserInfo()
					.size() <= 2) {
				fragment_myrl_import_user_img3.setVisibility(View.GONE);
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUserInfo()
					.size() <= 3) {
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUserInfo()
					.size() <= 4) {
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUserInfo()
					.size() < 5) {
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUser_info()
					.size() < 6) {
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
			}
		} else if (activity_Overview_Models.get(position).getUser() != null
				&& activity_Overview_Models.get(position).getUser().size() > 0) {
			for (int i = 0; i < activity_Overview_Models.get(position)
					.getUser().size(); i++) {
				switch (i) {
				case 0:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser().get(0).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img1, options);
					break;
				case 1:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser().get(1).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img2, options);
					break;
				case 2:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser().get(2).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img3, options);
					break;
				case 3:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser().get(3).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img4, options);
					break;
				case 4:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser().get(4).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img5, options);
					break;
				case 5:
					ImageLoader.getInstance().displayImage(
							Constants.BadiDownImgUrl
									+ activity_Overview_Models.get(position)
											.getUser().get(5).getHead()
									+ Constants.appPhoto4img,
							fragment_myrl_import_user_img6, options);
					break;

				default:
					break;
				}
			}
			fragment_myrl_import_user_img1.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img2.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img3.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img4.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img5.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_img6.setVisibility(View.VISIBLE);
			fragment_myrl_import_user_more.setVisibility(View.VISIBLE);
			if (activity_Overview_Models.get(position).getUser().size() <= 5) {
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			}
			if (activity_Overview_Models.get(position).getUser().size() <= 1) {
				fragment_myrl_import_user_img2.setVisibility(View.GONE);
				fragment_myrl_import_user_img3.setVisibility(View.GONE);
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUser().size() <= 2) {
				fragment_myrl_import_user_img3.setVisibility(View.GONE);
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUser().size() <= 3) {
				fragment_myrl_import_user_img4.setVisibility(View.GONE);
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUser().size() <= 4) {
				fragment_myrl_import_user_img5.setVisibility(View.GONE);
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUser().size() < 5) {
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
				fragment_myrl_import_user_more.setVisibility(View.GONE);
			} else if (activity_Overview_Models.get(position).getUser().size() < 6) {
				fragment_myrl_import_user_img6.setVisibility(View.GONE);
			}
		} else {
			fragment_myrl_import_user_img1.setVisibility(View.GONE);
			fragment_myrl_import_user_img2.setVisibility(View.GONE);
			fragment_myrl_import_user_img3.setVisibility(View.GONE);
			fragment_myrl_import_user_img4.setVisibility(View.GONE);
			fragment_myrl_import_user_img5.setVisibility(View.GONE);
			fragment_myrl_import_user_img6.setVisibility(View.GONE);
			fragment_myrl_import_user_more.setVisibility(View.GONE);
		}
		frame_activity_check.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
//				   
//						+ activity_Overview_Models.get(position).getStatus());
				if (is_main_ye.equals("1")) {
					// if (activity_Overview_Models.get(position).getStatus() !=
					// null
					// && activity_Overview_Models.get(position)
					// .getStatus().equals("1")) {
					Intent intent = new Intent(context,
							ActivityReadingActivity.class);
					intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
					if (activity_Overview_Models.get(position).getIs_online()
							.equals("1")) {
						intent.putExtra("isOnLine", true);
					} else {
						intent.putExtra("isOnLine", false);
					}
					intent.putExtra("actId",
							activity_Overview_Models.get(position).getId());
					if (activity_Overview_Models.get(position).getA_uid() != null) {
						intent.putExtra("fq_uid",
								activity_Overview_Models.get(position)
										.getA_uid());
					} else {
						intent.putExtra("fq_uid",
								activity_Overview_Models.get(position).getUid());
					}
					context.startActivity(intent);
					// } else {
					// Toast.makeText(
					// context,
					// context.getResources().getString(
					// R.string.wx_txt_100), 0).show();
					// }
				} else if (is_main_ye.equals("2")) {
					Intent intent = new Intent(context,
							ActivityReadingActivity.class);
					intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
					if (activity_Overview_Models.get(position).getIs_online()
							.equals("1")) {
						intent.putExtra("isOnLine", true);
					} else {
						intent.putExtra("isOnLine", false);
					}
					intent.putExtra("actId",
							activity_Overview_Models.get(position).getId());
					if (activity_Overview_Models.get(position).getA_uid() != null) {
						intent.putExtra("fq_uid",
								activity_Overview_Models.get(position)
										.getA_uid());
					} else {
						intent.putExtra("fq_uid",
								activity_Overview_Models.get(position).getUid());
					}
					context.startActivity(intent);
				}
			}
		});
		see_canyuzhe.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub

				/*if (!Utils.getUid(context).equals("")) {*/
					Intent intent = new Intent(
							context,
							PinyinSeeActivityTheOriginatorLookParticipantsActivity.class);
					intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
					intent.putExtra("aid",
							activity_Overview_Models.get(position).getId());
					if (activity_Overview_Models.get(position).getA_uid() != null) {
						intent.putExtra("fq_uid",
								activity_Overview_Models.get(position)
										.getA_uid());
					} else {
						intent.putExtra("fq_uid",
								activity_Overview_Models.get(position).getUid());
					}
					context.startActivity(intent);
				}
				// else if (!Utils.getUid(context).equals("")) {
				// Intent intent = new Intent(
				// context,
				// PinyinSeeActivityTheOriginatorLookParticipantsActivity.class);
				// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				// intent.putExtra("aid",
				// activity_Overview_Models.get(position).getId());
				// if (activity_Overview_Models.get(position).getA_uid() !=
				// null) {
				// intent.putExtra("fq_uid",
				// activity_Overview_Models.get(position)
				// .getA_uid());
				// } else {
				// intent.putExtra("fq_uid",
				// activity_Overview_Models.get(position).getUid());
				// }
				//
				// context.startActivity(intent);
				// }
				/*else {
					Toast.makeText(context,
							context.getResources().getString(R.string.l_xb10), 0)
							.show();
				}
			}*/
		});
		return convertView;
	}

	public double getMap_x() {
		return map_x;
	}

	public void setMap_x(double map_x) {
		this.map_x = map_x;
	}

	public double getMap_y() {
		return map_y;
	}

	public void setMap_y(double map_y) {
		this.map_y = map_y;
	}
}
